//
//  WKMyWalletFooterView.m
//  ourToken
//
//  Created by wakeup on 2018/6/1.
//  Copyright © 2018年 ourtoken. All rights reserved.
//

#import "WKMyWalletFooterView.h"
#import "WKBaseHeader.h"

@implementation WKMyWalletFooterView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.walletCopyBtn];
        [self addSubview:self.walletDeleteBtn];
    }
    return self;
}

- (UIButton *)walletCopyBtn {
    if (_walletCopyBtn == nil) {
        _walletCopyBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        _walletCopyBtn.frame = CGRectMake(50, 20, AppManager.width-100, 44);
        [_walletCopyBtn setTitle:@"备份" forState:UIControlStateNormal];
        [_walletCopyBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _walletCopyBtn.backgroundColor = AppManager.themeColor;
        _walletCopyBtn.titleLabel.font = AppManager.btnFont;
        _walletCopyBtn.layer.cornerRadius = 5;
        _walletCopyBtn.layer.masksToBounds = YES;
    }
    return _walletCopyBtn;
}

- (UIButton *)walletDeleteBtn {
    if (_walletDeleteBtn == nil) {
        _walletDeleteBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        _walletDeleteBtn.frame = CGRectMake(50, CGRectGetMaxY(self.walletCopyBtn.frame)+25, AppManager.width-100, 44);
        [_walletDeleteBtn setTitle:@"删除" forState:UIControlStateNormal];
        _walletDeleteBtn.layer.cornerRadius = 5;
        _walletDeleteBtn.layer.borderColor = [[UIColor blackColor] CGColor];
        _walletDeleteBtn.layer.borderWidth = 1;
        _walletDeleteBtn.backgroundColor = [UIColor whiteColor];
        _walletDeleteBtn.titleLabel.font = AppManager.btnFont;
        [_walletDeleteBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [_walletDeleteBtn addTarget:self action:@selector(clickDeleteWallet) forControlEvents:UIControlEventTouchUpInside];
    }
    return _walletDeleteBtn;
}

- (void)clickDeleteWallet {
    if (self.deleteBlock) {
        self.deleteBlock();
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
